/* 
 * File:   APEPluginIO.h
 * Author: hao
 *
 * Created on 2011年5月17日, 下午11:52
 */

#ifndef APEPLUGINIO_H
#define	APEPLUGINIO_H

#include <cstring>

#include <mac/IO.h>

class APEPluginIO : public CIO{
public:
    APEPluginIO();
    
    int Open( const wchar_t * pName ){
        return 0;
    }
    
    int Close(){
        return 0;
    }
    
    int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead);
    int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten){
        return 0;
    }
    
    int Seek(int nDistance, unsigned int nMoveMode);
    
    int Create(const wchar_t * pName){
        return 0;
    }
    int Delete(){
        return 0;
    }
    
    int SetEOF();

    int GetPosition(){
        return currentposition;
    }
    int GetSize(){
        return Length;
    }
    int GetName(wchar_t * pBuffer){
        pBuffer[0] = '\0';
        return 1;
    }
    
    void setData( char * pData, unsigned long long length ){
        data = pData;
        Length = length;
    }
    
    virtual ~APEPluginIO();
private:
    
    char * data;
    
    unsigned long long currentposition;
    
    unsigned long long Length;

};

#endif	/* APEPLUGINIO_H */

